package com.entity;

import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.RelationOneToMany;
import com.mybatisflex.annotation.Table;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 订单表 实体类。
 *
 * @author admin
 * @since 2024-05-30
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table("f_order")
public class FOrder implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 索引
     */
    @Id(keyType = KeyType.Auto)
    private Integer id;

    /**
     * 订单号
     */
    private String orderNo;

    /**
     * 订单状态 订单状态 1：未付款 2：已付款 3：已发货 4：已收货
     */
    private Integer status;

    /**
     * 下单时间
     */
    private String time;

    /**
     * 购买用户
     */
    private String userName;

    /**
     * 手机号
     */
    private String phone;

    /**
     * 收货地址
     */
    private String address;

    /**
     * 订单总价
     */
    private BigDecimal totalPrice;

    /**
     * 支付状态
     */
    private Integer payStatus;

    /**
     * 用户id
     */
    private Integer userId;

    //订单和订单详情是1对多关系
    @RelationOneToMany(selfField = "id", targetField = "orderId")
    private List<FOrderdetail> fOrderdetail;

}
